<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style type="text/css">
	
</style>
</head>

<body onLoad="shijian(),draw()">
<script type="text/javascript">
	

		function sanjiao(){
			for(i=1;i<=5;i++){
				for(x=4;x>=i;x--){
					document.write('&nbsp;')
					}
				for(y=1;y<=2*i-1;y++){
					document.write('*')
					}
					document.write('<br/>')
				}
			}
		function shijian(){
			a=new Date;
			b=a.getHours();
			c=a.getMinutes();
			d=a.getSeconds();
			document.getElementById('p1').innerHTML=(22-b)+":"+(60-c)+":"+(60-d);
			setTimeout(shijian,100);
			}
		var i=0,j=0,x;
		function draw(){
		
			setInterval(huahua,10)
			}
		function huahua(){
		
			if(j<500){
				
				j=5*i*i/100;
				i+=1;
				a=document.getElementById('huabu').getContext('2d');
				a.clearRect(0,0,400,600);
				a.fillStyle=document.getElementById('box').style.background;
				a.fillRect(200,j,30,30);
				
				}
				
			else{
				
				x=5*i*i/100;
				i-=1;
				a=document.getElementById('huabu').getContext('2d');
				a.clearRect(0,0,400,600);
				
				a.fillRect(200,x,30,30);
				if(i==0){
					j=0;
					huanfu(parseInt(document.getElementById('txt').value)+1)
					}
				}
			}
     			function huanfu(a){
				document.getElementById('txt').value=parseInt(document.getElementById('txt').value)+1
				b=document.getElementById('txt').value;
				if(b%6==1){
					a=1
					}
					if(b%6==2){
					a=2
					}
					if(b%6==3){
					a=3
					}
					if(b%6==4){
					a=4
					}
					if(b%6==5){
					a=5
					}
					if(b%6==0){
					a=6
					}
				switch(a){
					case 1:document.getElementById('box').style.background="rgb(124,255,111)";
				
					break;
					case 2:document.getElementById('box').style.background="rgb(12,25,111)";break;
					case 3:document.getElementById('box').style.background="rgb(124,25,11)";break;
					case 4:document.getElementById('box').style.background="rgb(124,255,111)";break;
					case 5:document.getElementById('box').style.background="rgb(12,255,1)";break;
					case 6:document.getElementById('box').style.background="rgb(124,2,111)";break;
					}
				}
</script>
<p id="p1">2342</p>
<canvas id="huabu" width="400" height="600"></canvas>
<img src="shijian.jpg" name="a1"/>
<input  type="text" id="txt" value="0">
<a href="#" onMouseOver="huanfu(parseInt(document.getElementById('txt').value)">换皮肤</a>
<div id="box" style="background:green; visibility:hidden; width:100px; position:absolute; left:170px; font-size:18px; font-weight:900; text-align:center; line-height:100px; top:500px; height:100px">救命啊！！</div>

<a onClick="sanjiao()">点击打印三角</a>
</body>
</html>
